package com.example.addressdemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.example.addressdemo.DB.DBAdapter;

/**
 * Created by 十田田 on 2021/5/30.
 */

public class CallActivity extends AppCompatActivity {
    private DBAdapter dbAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.d("CallActivity","onCreate") ;
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_call);
        TextView call_name = (TextView) findViewById(R.id.call_name);
        TextView call_phone = (TextView) findViewById(R.id.call_phone);
        ImageButton redcall=(ImageButton) findViewById(R.id.redcall);


        dbAdapter = new DBAdapter(this);
        final Bundle bundle = this.getIntent().getExtras();
        String name = bundle.getString("name");
        String phone = bundle.getString("phone");

        call_name.setText(name);
        call_phone.setText(phone);

        redcall.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(CallActivity.this, MainActivity.class);
                startActivity(intent);
            }
        });
    }
}
